package com.homemanager.management;

import com.homemanager.entities.DatabaseObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Valiantsin_Vlasau on 6/20/13.
 */
public class RepositoryBase<T extends DatabaseObject> {
    protected List<T> collection;

    public  RepositoryBase(){
        collection = new ArrayList<T>();
    }

    public boolean contains(int id){
        for (T item : collection){
            if (item.getId() == id)
                return true;
        }
        return false;
    }
}
